CREATE TABLE [dbo].[TDPLAN_DOXC]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[TI_PLAN] [dbo].[TD_VC_001] NOT NULL,
[NU_PLAN] [dbo].[TD_VC_008] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDPLAN_DO__NU_SE__17786E0C] DEFAULT ((0)),
[TI_DOCU] [dbo].[TD_VC_003] NOT NULL,
[NU_DOCU_CLIE] [dbo].[TD_VC_020] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[FE_EMIS] [dbo].[TD_DT_001] NOT NULL,
[FE_VENC] [dbo].[TD_DT_001] NOT NULL,
[CO_ESTA_DOCU] [dbo].[TD_VC_003] NOT NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[IM_TOTA] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDPLAN_DO__IM_TO__186C9245] DEFAULT ((0)),
[IM_PAGA] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDPLAN_DO__IM_PA__1960B67E] DEFAULT ((0)),
[CO_ESTA_NUEV] [dbo].[TD_VC_003] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDPLAN_DO__CO_US__1A54DAB7] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDPLAN_DO__FE_US__1B48FEF0] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDPLAN_DO__CO_US__1C3D2329] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDPLAN_DO__FE_US__1D314762] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDPLAN_DOXC] ADD CONSTRAINT [PK__TDPLAN_D__BC6B15E80DE4E231] PRIMARY KEY CLUSTERED  ([CO_EMPR], [TI_PLAN], [NU_PLAN], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDPLAN_DOXC] ADD CONSTRAINT [FK__TDPLAN_DOXC__63D999CC] FOREIGN KEY ([CO_EMPR], [TI_PLAN], [NU_PLAN]) REFERENCES [dbo].[TCPLAN_DOXC] ([CO_EMPR], [TI_PLAN], [NU_PLAN])
GO
